# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Surveys.V2.Model.SurveyQuestion do
  @moduledoc """
  Message defining the question specifications.

  ## Attributes

  *   `answerOrder` (*type:* `String.t`, *default:* `nil`) - The randomization option for multiple choice and multi-select questions. If not specified, this option defaults to randomize.
  *   `answers` (*type:* `list(String.t)`, *default:* `nil`) - Required list of answer options for a question.
  *   `hasOther` (*type:* `boolean()`, *default:* `nil`) - Option to allow open-ended text box for Single Answer and Multiple Answer question types. This can be used with SINGLE_ANSWER, SINGLE_ANSWER_WITH_IMAGE, MULTIPLE_ANSWERS, and MULTIPLE_ANSWERS_WITH_IMAGE question types.
  *   `highValueLabel` (*type:* `String.t`, *default:* `nil`) - For rating questions, the text for the higher end of the scale, such as 'Best'. For numeric questions, a string representing a floating-point that is the maximum allowed number for a response.
  *   `images` (*type:* `list(GoogleApi.Surveys.V2.Model.SurveyQuestionImage.t)`, *default:* `nil`) - 
  *   `lastAnswerPositionPinned` (*type:* `boolean()`, *default:* `nil`) - Currently only support pinning an answer option to the last position.
  *   `lowValueLabel` (*type:* `String.t`, *default:* `nil`) - For rating questions, the text for the lower end of the scale, such as 'Worst'. For numeric questions, a string representing a floating-point that is the minimum allowed number for a response.
  *   `mustPickSuggestion` (*type:* `boolean()`, *default:* `nil`) - Option to force the user to pick one of the open text suggestions. This requires that suggestions are provided for this question.
  *   `numStars` (*type:* `String.t`, *default:* `nil`) - Number of stars to use for ratings questions.
  *   `openTextPlaceholder` (*type:* `String.t`, *default:* `nil`) - Placeholder text for an open text question.
  *   `openTextSuggestions` (*type:* `list(String.t)`, *default:* `nil`) - A list of suggested answers for open text question auto-complete. This is only valid if single_line_response is true.
  *   `question` (*type:* `String.t`, *default:* `nil`) - Required question text shown to the respondent.
  *   `sentimentText` (*type:* `String.t`, *default:* `nil`) - Used by the Rating Scale with Text question type. This text goes along with the question field that is presented to the respondent, and is the actual text that the respondent is asked to rate.
  *   `singleLineResponse` (*type:* `boolean()`, *default:* `nil`) - Option to allow multiple line open text responses instead of a single line response. Note that we don't show auto-complete suggestions with multiple line responses.
  *   `thresholdAnswers` (*type:* `list(String.t)`, *default:* `nil`) - The threshold/screener answer options, which will screen a user into the rest of the survey. These will be a subset of the answer option strings.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Required field defining the question type. For details about configuring different type of questions, consult the question configuration guide.
  *   `unitOfMeasurementLabel` (*type:* `String.t`, *default:* `nil`) - Optional unit of measurement for display (for example: hours, people, miles).
  *   `videoId` (*type:* `String.t`, *default:* `nil`) - The YouTube video ID to be show in video questions.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :answerOrder => String.t(),
          :answers => list(String.t()),
          :hasOther => boolean(),
          :highValueLabel => String.t(),
          :images => list(GoogleApi.Surveys.V2.Model.SurveyQuestionImage.t()),
          :lastAnswerPositionPinned => boolean(),
          :lowValueLabel => String.t(),
          :mustPickSuggestion => boolean(),
          :numStars => String.t(),
          :openTextPlaceholder => String.t(),
          :openTextSuggestions => list(String.t()),
          :question => String.t(),
          :sentimentText => String.t(),
          :singleLineResponse => boolean(),
          :thresholdAnswers => list(String.t()),
          :type => String.t(),
          :unitOfMeasurementLabel => String.t(),
          :videoId => String.t()
        }

  field(:answerOrder)
  field(:answers, type: :list)
  field(:hasOther)
  field(:highValueLabel)
  field(:images, as: GoogleApi.Surveys.V2.Model.SurveyQuestionImage, type: :list)
  field(:lastAnswerPositionPinned)
  field(:lowValueLabel)
  field(:mustPickSuggestion)
  field(:numStars)
  field(:openTextPlaceholder)
  field(:openTextSuggestions, type: :list)
  field(:question)
  field(:sentimentText)
  field(:singleLineResponse)
  field(:thresholdAnswers, type: :list)
  field(:type)
  field(:unitOfMeasurementLabel)
  field(:videoId)
end

defimpl Poison.Decoder, for: GoogleApi.Surveys.V2.Model.SurveyQuestion do
  def decode(value, options) do
    GoogleApi.Surveys.V2.Model.SurveyQuestion.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Surveys.V2.Model.SurveyQuestion do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
